#!/usr/bin/env node

const EventEmitter  = require('events').EventEmitter,
      log = console.log;

const ev = new EventEmitter();

setInterval(()=>{
  ev.emit('hello');
},1000);
setTimeout(()=>{
  ev.emit('bye');
},5000);

ev.on('hello',()=>{
  log('hello world');
});

ev.on('bye',()=>{
  log('goodbye');
})
